package com.jinxin.platform.cdfaceacs.service.impl;

import com.jinxin.platform.cdfaceacs.mapper.CdattendancerecordReportMapper;
import com.jinxin.platform.cdfaceacs.pojo.domains.CdattendancerecordReport;
import com.jinxin.platform.cdfaceacs.service.CdattendancerecordReportService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 门禁记录模块-上报数据表(CdattendancerecordReport)表服务实现类
 *
 * @author yangjie
 * @since 2021-04-23 10:03:12
 */
@Service("cdattendancerecordReportService")
public class CdattendancerecordReportServiceImpl implements CdattendancerecordReportService {
    @Resource
    private CdattendancerecordReportMapper cdattendancerecordReportMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public CdattendancerecordReport queryById(String id) {
        return this.cdattendancerecordReportMapper.queryById(id);
    }

    /**
     * 查询多条数据
     *
     * @param cdattendancerecordReport 实例对象
     * @return 对象列表
     */
    @Override
    public List<CdattendancerecordReport> queryAll(CdattendancerecordReport cdattendancerecordReport) {
        return this.cdattendancerecordReportMapper.queryAll(cdattendancerecordReport);
    }

    /**
     * 新增数据
     *
     * @param cdattendancerecordReport 实例对象
     * @return 实例对象
     */
    @Override
    public CdattendancerecordReport insert(CdattendancerecordReport cdattendancerecordReport) {
        this.cdattendancerecordReportMapper.insert(cdattendancerecordReport);
        return cdattendancerecordReport;
    }

    /**
     * 修改数据
     *
     * @param cdattendancerecordReport 实例对象
     * @return 实例对象
     */
    @Override
    public CdattendancerecordReport update(CdattendancerecordReport cdattendancerecordReport) {
        this.cdattendancerecordReportMapper.update(cdattendancerecordReport);
        return this.queryById(cdattendancerecordReport.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(String id) {
        return this.cdattendancerecordReportMapper.deleteById(id) > 0;
    }

}
